<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <h1>{{msg}}</h1>
  </div>
  <button onclick="change()">点击</button>
  <script src="./vue.js"></script>
  <script>  
   let vm=new Vue({
    el:"#app",
    data(){
      return {
        msg:"hello",
      }
    },
    computed:{
      
    },
    watch:{},
    methods:{
      say(){
        console.log(this.msg)
        console.log(this.$options)
      }
    }
   })

      function change(){
        console.log(1111)
        vm.$data.msg="世界"
        vm.$el.style.backgroundColor="red"
        // vm.$options----获取vue的所有配置项
        console.log(vm.$options,"------------")
          
      }
      // 实例外部访问 watch
      vm.$watch("msg",(newVal,oldVal)=>{
          console.log(newVal,"新的值")
      })
   
   
  </script>
</body>
</html>